/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 *  \file     Mcu_ResetDrv.h                                                                           *
 *  \brief    This file contains interface header for MCU MCAL driver, ...                             *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/02     <td>1.0.0                               *
 * </table>                                                                                             *
 *******************************************************************************************************/
#ifndef MCU_RESETDRV_H
#define MCU_RESETDRV_H

/** *****************************************************************************************************
 * \brief Assert a reset signal.
 *
 * \verbatim
 * Syntax             : Std_ReturnType Mcu_Ip_ResetDrvAssert(uint32 base, uint32 id)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : base - Reset base address.
 *                      id - reset signal id
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : 0 if OK, or a error code.
 *
 * Description        : Assert a reset signal.
 *
 * \endverbatim
 *******************************************************************************************************/
Std_ReturnType Mcu_Ip_ResetDrvAssert(uint32 base, uint32 id);
/** *****************************************************************************************************
 * \brief Deassert a reset signal.
 *
 * \verbatim
 * Syntax             : Std_ReturnType Mcu_Ip_ResetDrvDeassert(uint32 base, uint32 id)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : base - Reset base address.
 *                      id - reset signal id
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : 0 if OK, or a error code.
 *
 * Description        : Deassert a reset signal.
 *
 * \endverbatim
 *******************************************************************************************************/
Std_ReturnType Mcu_Ip_ResetDrvDeassert(uint32 base, uint32 id);
/** *****************************************************************************************************
 * \brief Assert a reset signal, and deassert automatically.
 *
 * \verbatim
 * Syntax             : Std_ReturnType Mcu_Ip_ResetDrvReset(uint32 base, uint32 id)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : base - Reset base address.
 *                      id - reset signal id
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : 0 if OK, or a error code.
 *
 * Description        : Assert a reset signal, and deassert automatically.
 *
 * \endverbatim
 *******************************************************************************************************/
Std_ReturnType Mcu_Ip_ResetDrvReset(uint32 base, uint32 id);

/** *****************************************************************************************************
 * \brief Global reset.
 *
 * \verbatim
 * Syntax             : void Mcu_Ip_ResetDrvGlobalReset(uint32 base)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : base - Reset base address.
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : Global reset.
 *
 * \endverbatim
 *******************************************************************************************************/
void Mcu_Ip_ResetDrvGlobalReset(uint32 base);
/** *****************************************************************************************************
 * \brief Check reset signal status.
 *
 * \verbatim
 * Syntax             : uint32 Mcu_Ip_ResetDrvStatus(uint32 base, uint32 id)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : base - Reset base address.
 *                      id - reset signal id
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : 0 if deasserted, 1 if asserted,
 *                      or UINT32_MAX means error occured.
 *
 * Description        : Check reset signal status.
 *
 * \endverbatim
 * Traceability       : SW_SM006
 *******************************************************************************************************/
uint32 Mcu_Ip_ResetDrvStatus(uint32 base, uint32 id);

#endif /* MCU_RESETDRV_H */
/* End of file */
